'use strict';

module.exports = appInfo => {
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1549235952499_2015';

  // add your config here
  /* 配置session */
  config.session = {
    key: 'SESSION_ID',
    maxAge: 864000,
    httpOnly: true,
    encrypt: true,
    renew: true, // 延长时间
  };
  config.middleware = [ 'compress' , 'adminauth' ];
  config.compress = {
    threshold: 1024,
  };
  config.adminauth = {
    match: '/',
  }
  exports.view = {
    defaultViewEngine: 'ejs',
    mapping: {
      '.html': 'ejs',
    },
  };

  return config;
};
